﻿using System;
using System.Data;

namespace ltModel.BLL
{
    /// <summary>
    /// 业务逻辑类article_user 的摘要说明。
    /// </summary>
    public class article_user
    {
        private readonly ltModel.DAL.article_user dal = new ltModel.DAL.article_user();
        public article_user()
        { }
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int user_id)
        {
            return dal.Exists(user_id);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(ltModel.Model.article_user model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(ltModel.Model.article_user model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 锁定解锁用户
        /// </summary>
        /// <param name="user_id">用户</param>
        /// <param name="lk">状态</param>
        public void LockEdit(string user_id, string lk)
        {
            dal.LockEdit(user_id, lk);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int user_id)
        {
            return dal.Delete(user_id);
        }

        /// <summary>
        /// 删除数据
        /// </summary>
        public bool Delete(string user_id)
        {
            return dal.Delete(user_id);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ltModel.Model.article_user GetModel(int user_id)
        {
            return dal.GetModel(user_id);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        /// <summary>
        /// 获得数据列表
        /// <param name="topNum">获取记录条数</param>
        /// <param name="strWhere">条件</param>
        /// </summary>
        public DataSet GetList(string topNum, string strWhere)
        {
            return dal.GetList(topNum, strWhere);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return dal.GetList("");
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        /// <summary>
        /// 更新最后登录时间
        /// </summary>
        public void UpdateLoginTime(int uid)
        {
            ltModel.Model.article_user abo = new ltModel.Model.article_user();
            abo.user_id = uid;
            abo.lasttime = DateTime.Now.ToString();
            dal.Update(abo);
        }

        #endregion  成员方法
    }
}